import request from '@/utils/request'

// 查询对外付款列表
export function listOaPayment(query) {
  return request({
    url: '/payment/oaPayment/list',
    method: 'get',
    params: query
  })
}

export function listOaPaymentByResult(query) {
  return request({
    url: '/payment/oaPayment/listByResult',
    method: 'get',
    params: query
  })
}

// 查询对外付款详细
export function getOaPayment(id) {
  return request({
    url: '/payment/oaPayment/' + id,
    method: 'get'
  })
}

// 保存对外付款
export function saveOaPayment(data) {
  return request({
    url: '/payment/oaPayment/save',
    method: 'post',
    data: data
  })
}

// 删除对外付款
export function delOaPayment(id) {
  return request({
    url: '/payment/oaPayment/' + id,
    method: 'delete'
  })
}

// 导出对外付款
export function exportOaPayment(query) {
  return request({
    url: '/payment/oaPayment/export',
    method: 'get',
    params: query
  })
}

// 删除付款主体
export function deleteOaPaymentDetail(id) {
  return request({
    url: '/payment/oaPayment/detail/' + id,
    method: 'delete'
  })
}

// 收款方历史记录
export function getPayeeHistory() {
  return request({
    url: '/payment/oaPayment/getPayeeHistory',
    method: 'get'
  })
}

// 维护付款时间
export function updatePayTime(data) {
  return request({
    url: '/payment/oaPayment/updatePayTime',
    method: 'post',
    data: data
  })
}
